package com.zzptc.zzsgz;


public class Test {
    public static void main(String[] args) {
        System.out.println(Thread.currentThread().getName());
        //启动线程
        new MyThread().start();
        new MyNewThread().start();

        MyRunnable myRunnable= new MyRunnable();
        new Thread(myRunnable).start();

       //匿名内部类的方式写
        new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName());
            }
        }).start();


    }

    //内部类
    static class MyNewThread extends Thread{
        @Override
        public void run() {
            System.out.println(Thread.currentThread().getName());
        }
    }
}
